// pages/search/search.js
Page({
  data: {
   result:"",
   word:""
  },
  iword(e){
    this.setData({
      word: e.detail.value
    })
  },
  search(){
    let self=this
      wx.request({
        url: `https://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.catalogSug&query=${this.data.word}`,
        dataType: 'json',
        success: function(res) {
         self.setData({
           result:res.data.song
         })
         console.log(self.result)
        },
      })
  }
 
})